package com.base.pig.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 点位 Mapper 接口
 * </p>
 *
 * @author yjh
 * @since 2022-04-15
 */
@Mapper
public interface ScMonitorMapper extends BaseMapper {

    // 查询点
    //@Select(" SELECT smID,smX,smY,smLibTileID,smUserID,pointID,pointName,remarks,center_X,center_Y,center_Z " +
         //   " FROM ${tableName}    where  pointid  =#{pointid}    ")
   // List<Map<String,Object>> queryDeviceInfo(@Param("tableName") String tableName, @Param("pointid") String pointid);

    //条件查询监测点
    @Select(" SELECT smID,smX,smY,smLibTileID,smUserID,pointID,pointName,remarks,center_X,center_Y,center_Z,pipeType " +
            " FROM  ${tableName}  ${ew.customSqlSegment} ")
    List<Map<String,Object>> queryMonitorInfoByCondition(@Param("tableName") String tableName, @Param(Constants.WRAPPER) Wrapper wrapper);


    //条件查询监测点（分页）
    @Select(" SELECT smID,smX,smY,smLibTileID,smUserID,pointID,pointName,remarks,center_X,center_Y,center_Z,pipeType " +
            " FROM ${tableName}  ${ew.customSqlSegment} ")
    Page<Map<String, Object>> queryMonitorInfoByConditionPage(Page page, @Param("tableName") String tableName, @Param(Constants.WRAPPER) Wrapper wrapper); //复杂查询分页返回map


}
